/* Ejercicio 5.20
   ejer5_20.c */
#include <stdio.h>

/* Prototypes */
void printSquare( int side, char fillCharacter );

/* function main begins program execution */
int main( void )
{
    int s;
    char car;

    printf( "Enter a number: " );
    scanf( "%d", &s );
    getchar();
    printf( "Enter a character: " );
    car = getchar();

    printSquare( s, car );
	return 0;

} /* end function main */

/* prints a square of a side with the fillCharacter */
void printSquare( int side, char fillCharacter )
{
    int i, j;

    for ( i = 1; i <= side; i++ ) {

        for ( j = 1; j <= side; j++ ) {
            printf( "%c", fillCharacter );
        }

        printf( "\n" );
    }
} /* end function printSquare */
